{extend name='admin@main'}
{block name="content"}
<div class="think-box-shadow">
    {include file='user/search_distribution'}
    <table class="layui-table margin-top-10" lay-skin="line" >
        <thead>
        <tr>
            <th class="text-left nowrap" style="padding-left: 155px;" >统计</th>
            <th class='text-left nowrap'>活跃总时长:{$data['total_time']|intdiv='60'}分钟</th>
            <th class='text-left nowrap'>
                活跃人均时长:
                {$data[2]?intdiv($data['total_time']/$data[2],60):0}分钟
            </th>
        </tr>
        </thead>
    </table>

    <div class="margin-bottom-15">时长人群分布</div>
    {notempty name='$data.total_time'}
    <div class="layui-row layui-col-space14">
    <table class="layui-table margin-top-10" lay-skin="line" style="width: 50%;float: left;">
        <thead>
        <tr>
            <th class='text-left'>游戏时长(活跃)</th>
            <th class='text-left'>人数</th>
            <th class='text-left'>占比</th>
        </tr>
        </thead>
        <tbody>
            <tr>
                <td>
                    10s内
                </td>
                <td>
                    {$data[0][0]}
                </td>
                <td>
                    {$data[2]?(round($data[0][0]/$data[2]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    11-60s
                </td>
                <td>
                    {$data[0][1]}
                </td>
                <td>
                    {$data[2]?(round($data[0][1]/$data[2]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    2-3m
                </td>
                <td>
                    {$data[0][2]}
                </td>
                <td>
                    {$data[2]?(round($data[0][2]/$data[2]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    4-10m
                </td>
                <td>
                    {$data[0][3]}
                </td>
                <td>
                    {$data[2]?(round($data[0][3]/$data[2]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    11-30m
                </td>
                <td>
                    {$data[0][4]}
                </td>
                <td>
                    {$data[2]?(round($data[0][4]/$data[2]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    31-60m
                </td>
                <td>
                    {$data[0][5]}
                </td>
                <td>
                    {$data[2]?(round($data[0][5]/$data[2]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    1-2h
                </td>
                <td>
                    {$data[0][6]}
                </td>
                <td>
                    {$data[2]?(round($data[0][6]/$data[2]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    3-4h
                </td>
                <td>
                    {$data[0][7]}
                </td>
                <td>
                    {$data[2]?(round($data[0][7]/$data[2]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    ＞4h
                </td>
                <td>
                    {$data[0][8]}
                </td>
                <td>
                    {$data[2]?(round($data[0][8]/$data[2]*100,2)):0}
                </td>
            </tr>

        </tbody>
    </table>
    <table class="layui-table margin-top-10" lay-skin="line" style="width: 50%;float: left;">
        <thead>
        <tr>
            <th class='text-left'>游戏时长(新增)</th>
            <th class='text-left'>人数</th>
            <th class='text-left'>占比</th>
        </tr>
        </thead>
        <tbody>
            <tr>
                <td>
                    10s内
                </td>
                <td>
                    {$data[1][0]}
                </td>
                <td>
                    {$data[3]?(round($data[1][0]/$data[3]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    11-60s
                </td>
                <td>
                    {$data[1][1]}
                </td>
                <td>
                    {$data[3]?(round($data[1][1]/$data[3]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    2-3m
                </td>
                <td>
                    {$data[1][2]}
                </td>
                <td>
                    {$data[3]?(round($data[1][2]/$data[3]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    4-10m
                </td>
                <td>
                    {$data[1][3]}
                </td>
                <td>
                    {$data[3]?(round($data[1][3]/$data[3]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    11-30m
                </td>
                <td>
                    {$data[1][4]}
                </td>
                <td>
                    {$data[3]?(round($data[1][4]/$data[3]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    31-60m
                </td>
                <td>
                    {$data[1][5]}
                </td>
                <td>
                    {$data[3]?(round($data[1][5]/$data[3]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    1-2h
                </td>
                <td>
                    {$data[1][6]}
                </td>
                <td>
                    {$data[3]?(round($data[1][6]/$data[3]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    3-4h
                </td>
                <td>
                    {$data[1][7]}
                </td>
                <td>
                    {$data[3]?(round($data[1][7]/$data[3]*100,2)):0}
                </td>
            </tr>

            <tr>
                <td>
                    ＞4h
                </td>
                <td>
                    {$data[1][8]}
                </td>
                <td>
                    {$data[3]?(round($data[1][8]/$data[3]*100,2)):0}
                </td>
            </tr>

        </tbody>
    </table>
    </div>
    {else/}
    <span class="notdata">没有记录哦</span>
    {/notempty}

    <div class="margin-bottom-15">倍率分布</div>
    {notempty name='$data2'}
    <div class="layui-row layui-col-space14">
        <table class="layui-table margin-top-10" lay-skin="line">
            <thead>
            <tr>
                <th class='text-left'>炮倍</th>
                <th class='text-left'>完成人数</th>
                <th class='text-left'>占比</th>
                <th class='text-left'>人均金币数</th>
                <th class='text-left'>人均钻石数</th>
            </tr>
            </thead>
            <tbody>
            {foreach $data2 as $key=>$vo}
            <tr>
                <td>
                    {$user_cannon[$vo['cannon_dist']]}
                </td>
                <td>
                    {$vo.cannon_num}
                </td>
                <td>
                    {$vo.num_rate*100}
                </td>
                <td>
                    {$vo.avg_score}
                </td>
                <td>
                    {$vo.avg_diamond}
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
    </div>
    {else/}
    <span class="notdata">没有记录哦</span>
    {/notempty}

    <div class="margin-bottom-15">等级分布</div>
    {notempty name='$data3'}
    <div class="layui-row layui-col-space14">
        <table class="layui-table margin-top-10" lay-skin="line">
            <thead>
            <tr>
                <th class='text-left'>等级</th>
                <th class='text-left'>完成人数</th>
                <th class='text-left'>占比</th>
                <th class='text-left'>人均金币数</th>
                <th class='text-left'>人均钻石数</th>
            </tr>
            </thead>
            <tbody>
            {foreach $data3 as $key=>$vo}
            <tr>
                <td>
                    {$user_level[$vo['level_dist']]}
                </td>
                <td>
                    {$vo.cannon_num}
                </td>
                <td>
                    {$vo.num_rate*100}
                </td>
                <td>
                    {$vo.avg_score}
                </td>
                <td>
                    {$vo.avg_diamond}
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
    </div>
    {else/}
    <span class="notdata">没有记录哦</span>
    {/notempty}
</div>
{/block}
